package com.appspot.diasporajava.dao;

import java.util.List;

import javax.persistence.Query;

import org.springframework.stereotype.Component;

import com.appspot.diasporajava.entities.Pod;

@Component
public class PodDao extends GenericDaoImpl<Pod>{
	public List<Pod> findByUrl(String url){
		final StringBuffer queryString = new StringBuffer("SELECT o from ");
		queryString.append(type.getSimpleName()).append(" o ");
		queryString.append(" where url like '%");
		queryString.append(url);
		queryString.append("%'");

		final Query query = this.emf.createEntityManager().createQuery(queryString.toString());

		return query.getResultList();
	}
}
